home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / misc / gs261src.zip / gxchar.h < prev    next >
C/C++ Source or Header  |  1993-05-27  |  5KB  |  121 lines

  1. /* Copyright (C) 1989, 1992, 1993 Aladdin Enterprises.  All rights reserved.
  2.  
  3. This file is part of Ghostscript.
  4.  
  5. Ghostscript is distributed in the hope that it will be useful, but
  6. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. to anyone for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.  Refer
  9. to the Ghostscript General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute
  12. Ghostscript, but only under the conditions described in the Ghostscript
  13. General Public License.  A copy of this license is supposed to have been
  14. given to you along with Ghostscript so you can know your rights and
  15. responsibilities.  It should be in a file named COPYING.  Among other
  16. things, the copyright notice and this notice must be preserved on all
  17. copies.  */
  18.  
  19. /* gxchar.h */
  20. /* Internal character definition for Ghostscript library */
  21. /* Requires gsmatrix.h, gxfixed.h, gzdevice.h */
  22. #include "gschar.h"
  23.  
  24. /* The type of cached characters is opaque. */
  25. #ifndef cached_char_DEFINED
  26. #  define cached_char_DEFINED
  27. typedef struct cached_char_s cached_char;
  28. #endif
  29. extern const uint cached_char_sizeof;
  30.  
  31. /* The type of cached font/matrix pairs is opaque. */
  32. #ifndef cached_fm_pair_DEFINED
  33. #  define cached_fm_pair_DEFINED
  34. typedef struct cached_fm_pair_s cached_fm_pair;
  35. #endif
  36. extern const uint cached_fm_pair_sizeof;
  37.  
  38. /* An enumeration object for string display. */
  39. typedef enum {
  40.     sws_none,
  41.     sws_cache,            /* setcachedevice */
  42.     sws_no_cache            /* setcharwidth */
  43. } show_width_status;
  44. struct gs_show_enum_s {
  45.     /* Following are set at creation time */
  46.     gs_state *pgs;
  47.     int level;            /* save the level of pgs */
  48.     const byte *str;        /* char may be signed! */
  49.     uint size;
  50.     float wcx, wcy;            /* for widthshow */
  51.     gs_char wchr;            /* ditto */
  52.     float ax, ay;            /* for ashow */
  53.     int add;            /* true if a[width]show */
  54.     int do_kern;            /* 1 if kshow, -1 if [x][y]show */
  55.                     /* or cshow, 0 otherwise */
  56.     int slow_show;            /* [a][width]show or kshow or */
  57.                     /* [x][y]show or cshow */
  58.     int charpath_flag;        /* 0 for show, 1 for false */
  59.                     /* charpath, 2 for true charpath */
  60.     int stringwidth_flag;        /* 0 for show/charpath, */
  61.                     /* 1 for stringwidth/cshow */
  62.     int can_cache;            /* true if can cache chars */
  63.     gs_int_rect ibox;        /* int version of quick-check */
  64.                     /* (inner) clipping box */
  65.     gs_int_rect obox;        /* int version of (outer) clip box */
  66.     int is_composite;        /* true if composite font */
  67.     int ftx, fty;            /* transformed font translation */
  68.     int wmode;            /* WMode of root font */
  69.     /* Following are updated dynamically */
  70.     gs_glyph (*encode_char)(P3(gs_show_enum *, struct gs_font_s *, gs_char *));
  71.                     /* copied from font, */
  72.                     /* except for glyphshow */
  73.     int cache_set;            /* true if suggested_scale & */
  74.                     /* dev_cache_info/dev have been set */
  75.     int suggested_scale;        /* suggested scaling factor for */
  76.                     /* oversampling, based on FontBBox */
  77.                     /* and CTM */
  78.     gx_device_memory dev_cache_info;
  79.     device dev_cache_dev;
  80.     gx_device_null dev_null;    /* null device for stringwidth */
  81.     uint index;            /* index within string */
  82.     gs_char current_char;        /* current char for render or move */
  83.     gs_glyph current_glyph;        /* current glyph ditto */
  84.     gs_fixed_point wxy;        /* width of current char */
  85.                     /* in device coords */
  86.     gs_fixed_point origin;        /* unrounded origin of current char */
  87.                     /* in device coords, needed for */
  88.                     /* charpath and WMode=1 */
  89.     cached_char *cc;        /* being accumulated */
  90.     gs_point width;            /* total width of string, set at end */
  91.     show_width_status width_status;
  92.     int current_scale;
  93.     int (*continue_proc)(P1(struct gs_show_enum_s *));    /* continuation procedure */
  94.     /* Following are dynamic, for composite fonts only */
  95. #define max_font_depth 5
  96.     struct gs_font_s *fstack[max_font_depth];
  97.     int fdepth;
  98.     struct gs_font_s *pfont;
  99. };
  100. #define gs_show_enum_s_DEFINED
  101.  
  102. /* Cached character procedures (in gxcache.c) */
  103. #ifndef gs_font_dir_DEFINED
  104. #  define gs_font_dir_DEFINED    
  105. typedef struct gs_font_dir_s gs_font_dir;
  106. #endif
  107. void    gx_char_cache_init(P1(gs_font_dir *));
  108. cached_char *
  109.     gx_alloc_char_bits(P4(gs_font_dir *, gx_device_memory *, ushort, ushort));
  110. void    gx_open_cache_device(P2(gx_device_memory *, cached_char *));
  111. void    gx_free_cached_char(P2(gs_font_dir *, cached_char *));
  112. cached_fm_pair *
  113.     gx_lookup_fm_pair(P1(const gs_state *));
  114. void    gx_add_cached_char(P5(gs_font_dir *, gx_device_memory *, cached_char *, cached_fm_pair *, int));
  115. void    gx_add_char_bits(P4(gs_font_dir *, gx_device_memory *, cached_char *, int));
  116. cached_char *
  117.     gx_lookup_cached_char(P4(const gs_state *, const cached_fm_pair *, gs_glyph, int));
  118. cached_char *
  119.     gx_lookup_xfont_char(P6(const gs_state *, cached_fm_pair *, gs_char, gs_glyph, gs_proc_glyph_name((*)), int));
  120. int    gx_image_cached_char(P2(gs_show_enum *, cached_char *));
  121.